package zjc.练习;

import java.util.Scanner;

public class 买飞机票 {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        System.out.println("请输入机票的价格:");
        double price=sr.nextDouble();
        System.out.println("请输入您选择的月份:");
        int month=sr.nextInt();
        System.out.println("请输入您选择的类型（经济舱或头等舱）");
        String leixing= sr.next();
        if(month>=5&&month<=10){
            switch (leixing){
                case "经济舱":price*=0.85;
                    break;
                case "头等舱":price*=0.9;
                    break;
                default:
                    System.out.println("您输入的飞机票类型错误");return;
            }
        }else if((0<month&&month<5)||(month>10&&month<13)){
            switch (leixing){
                case "经济舱":price*=0.7;
                    break;
                case "头等舱":price*=0.65;
                    break;
                default:
                    System.out.println("您输入的飞机票类型错误");return;
            }
        }else{
            System.out.println("您输入的月份有问题");
            return;
        }
        System.out.println("您的飞机票价格为："+price);

    }
}
